import copy from "rollup-plugin-copy";

export default function rollupCopy(env) {
  return copy({
    targets: [
      {
        src: "./node_modules/libpag/lib/libpag.wasm",
        dest: env.NODE_ENV === "production" ? "dist/" : "public/",
      },
    ],
    hook: env.NODE_ENV === "production" ? "writeBundle" : "buildStart",
  });
}
